package com.tjzx.common;

import java.util.List;

public class Pager<T> {
	private int pageNo;
	private int totalPages;
	private int rowCount;
	private List<T> list;

	public Pager(int pageNo, int pageSize, int rowCount, List<T> list) {
		super();
		this.pageNo = pageNo;
		this.rowCount = rowCount;
		this.list = list;
		
		int totalPages = rowCount / pageSize;
		if ((rowCount % pageSize) > 0) {
			totalPages +=1;
		}
		this.setTotalPages(totalPages);
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getTotalPages() {
		return totalPages;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}

	public int getRowCount() {
		return rowCount;
	}

	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}
}
